//**************************************************************************************
// CoveyRole Concrete Class File
//**************************************************************************************
// Created On: Sunday, March 06, 2011 as 3:49:48 AM
//**************************************************************************************

using System;
using DevExpress.Xpo;
using DevExpress.ExpressApp;
using DevExpress.Persistent.BaseImpl;

namespace Liekhus.TimeTracker.Module
{
    public partial class CoveyRole
    {
        public override void AfterConstruction()
        {
            base.AfterConstruction();

            User user = SecuritySystem.CurrentUser as User;
            if (user != null)
            {
                Owner = Session.GetObjectByKey<User>(user.Oid);
            }
            CreatedOn = DateTime.Now;
        }

        protected override void OnSaving()
        {
            base.OnSaving();
            ModifiedOn = DateTime.Now;
        }

        private User _Owner;
        public User Owner
        {
            get
            {
                return _Owner;
            }
            set
            {
                SetPropertyValue("Owner", ref _Owner, value);
            }
        }
    }
}
